package com.zzzmode.httpjob.web.controller;

import com.jfinal.core.Controller;
import com.zzzmode.httpjob.web.model.ApiError;
import com.zzzmode.jobwork.dao.MongoConnectManager;
import com.zzzmode.jobwork.dao.TaskModelDAO;
import com.zzzmode.jobwork.utils.StringUtils;

/**
 * Created by zl on 2014/12/7.
 */
public class TaskConfigController extends BaseController {

    private TaskModelDAO taskModelDAO= MongoConnectManager.getTaskModelDAO();

    public void index(){
        renderJsp("index.jsp");
    }

    public void getTaskInfo(){
        String id=getPara("id");
        if(!StringUtils.isEmpty(id)){
         renderJson(taskModelDAO.findById(id));
        }else {
            renderJson(paramsError());
        }

    }

}
